/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package fr.isen.web.webservicetemp.Entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Maistre Louis
 */

@Entity
public class Data implements Serializable {
   
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private long id;
    
    @Column(name = "name")
    private String name;
   
    @Column(name = "posx")
    private float posx;
    @Column(name = "posy")
    private float posy;
    @Column(name = "posz")
    private float posz;
    
    @Column(name = "location")
    private String location;
    @Column(name= "longitude")
    private float longitude;
    @Column(name= "latitude")
    private float latitude;
   
    @Column(name = "datecapture")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dateCapture;
    
    @Column(name = "datavalue", nullable = false)
    private float dataValue;
    
    @Column(name = "apisource")
    private String apiSource;

    public Data() {
        this.dataValue = 0;
    }
 
    public Data(long dataValue) {     
        this.dataValue = dataValue;
    }

    public Data(String name, float posx, float posy, float posz, long dataValue, String apiSource, Date date, float longitude, float latitude) {
        this.name = name;
        this.posx = posx;
        this.posy = posy;
        this.posz = posz;
        this.dataValue = dataValue;
        this.apiSource = apiSource;
        this.dateCapture = date;
        this.latitude = latitude;
        this.longitude = longitude;
    }
    
    //constructeur pour les classes filles uniquement
    public Data(String name, float posx, float posy, float posz, String apiSource, Date date, float longitude, float latitude) {
        this.name = name;
        this.posx = posx;
        this.posy = posy;
        this.posz = posz;
        this.apiSource = apiSource;
        this.dateCapture = date;
        this.latitude = latitude;
        this.longitude = longitude;
    }

    public float getLongitude() {
        return longitude;
    }

    public void setLongitude(float longitude) {
        this.longitude = longitude;
    }

    public float getLatitude() {
        return latitude;
    }

    public void setLatitude(float latitude) {
        this.latitude = latitude;
    }

    public String getApiSource() {
        return apiSource;
    }

    public void setApiSource(String apiSource) {
        this.apiSource = apiSource;
    }

    public Date getDateCapture() {
        return dateCapture;
    }

    public void setDateCapture(Date dateCapture) {
        this.dateCapture = dateCapture;
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setPosx(float posx) {
        this.posx = posx;
    }

    public void setPosy(float posy) {
        this.posy = posy;
    }

    public void setPosz(float posz) {
        this.posz = posz;
    }

    public String getName() {
        return name;
    }

    public float getPosx() {
        return posx;
    }

    public float getPosy() {
        return posy;
    }

    public float getPosz() {
        return posz;
    }

    public void setDataValue(float dataValue) {
        this.dataValue = dataValue;
    }

    public float getDataValue() {
        return dataValue;
    }



    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }
}
